<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>列表渲染</title>
</head>
<body>
    <div id="div">
        <!--需求1：循环展示vue中定义的数组的内容-->
        <ul>
            <li v-for="(name,index) in names">{{name}} ---------> {{index}}</li>
        </ul>

        <hr>
        <!--需求2：循环展示vue中定义的对象的内容-->
        <ul>
            <li v-for="value,name in student">{{name}}={{value}}</li>
        </ul>

        <span v-for="i in 5">※</span>
    </div>
</body>
<script src="js/vue.js"></script>
<script>
    new Vue({
        el:"#div",
        data:{
            names:["张益达","张大炮","snake"],
            student:{
                name:"金甲战士",
                age:22,
                address:"武汉"
            }
        }
    });
</script>
</html>